<?php 
if(KT!='KhiThe') exit;
class homeNews_model extends khithe_mysql{
	
	public function get_news($page,$limit)
	{		
	
		if($limit!=''){
			$page=($page==''?1:$page);
			$start = ($page - 1)* $limit; 
			$strlimit = "LIMIT $start, $limit";
		}
		else{
			$strlimit ='';
		}
		
		$query = "SELECT * FROM ".news." WHERE `Status`='true' order by ID DESC ".$strlimit." ";
		$note = parent::selectMySQL($query);	
		while ($row = mysql_fetch_assoc($note)){
			
			$arr[] = $row;
		}
		parent::CloseConnection();
		
		return isset($arr)?$arr:NULL;
	}

}
?>